#include "Drill.h"
#include "AnimateTool.h"
#include "FileHelper.h"

bool Drill::init() {
	if (!Node::init()) {
		return false;
	}
	this->animate=AnimateTool::createWithPlist("drill.plist", "drill", 0.3f);
	this->skin = Sprite::createWithSpriteFrame(animate->getAnimation()->getFrames().at(0)->getSpriteFrame());
	this->addChild(this->skin);
	auto mask = Sprite::create("Mask_level1.png");
	this->addChild(mask);

	//this->moveSpeed = 20;
	//this->max_life = 10;
	//this->max_blood = 1000;
	//this->max_equip_num = 5;
	//this->skill_att = new std::map<std::string, int>();
	//skill_att->insert(std::pair<std::string, int>("att1", 10));
	//skill_att->insert(std::pair<std::string, int>("att2", 20));
	//this->skill_num = new std::map<std::string, int>();
	//skill_num->insert(std::pair<std::string, int>("att1", 1));
	//skill_num->insert(std::pair<std::string, int>("att2", 2));
	//FileHelper::SaveDrill("./script/Drill.lua", this);

	FileHelper::GetDrill("./script/Drill.lua", this);
	log("%d",this->life);

	return true;
}